package com.dfrz.ch09.task;

public class Taper {

	private double height; 
	private double r;
	public Taper() {
		height = 7;
		r = 5;
	}
	public Taper(double height, double r) {
		super();
		this.height = height;
		this.r = r;
	}
	
	public double bulk(){
		return (Math.PI * r * r) * height / 3;
	}
	
	
	public double getHeight() {
		return height;
	}
	public void setHeight(double height) {
		this.height = height;
	}
	public double getR() {
		return r;
	}
	public void setR(double r) {
		this.r = r;
	}
	
	
}

class Test4{
	
	public static void main(String[] strs) {
		Taper taper = new Taper();
		double value = taper.bulk();
		System.out.println(value);
		
		taper.setHeight(10);
		taper.setR(10);
		value = taper.bulk();
		System.out.println(value);
		
	}
}
